import { createRouter, createWebHistory } from "vue-router";
import Home from "../views/Home.vue";

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/about",
    name: "About",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "about" */ "../views/About.vue"),
  },
  {
    path: "/template",
    name: "Template",
    component: () => import("../views/Template.vue"),
  },
  {
    path: "/main",
    name: "Main",
    component: () => import("../views/Main.vue"),
  },
  {
    path: "/funcTest",
    name: "FuncTest",
    component: () => import("../views/FuncTest.vue"),
  },
  {
    path: "/computedTest",
    name: "ComputedTest",
    component: () => import("../views/ComputedTest.vue"),
  },
  {
    path: "/reactiveData",
    name: "ReactiveData",
    component: () => import("../views/ReactiveData.vue"),
  },
  {
    path: "/routeTest",
    name: "RouteTest",
    component: () => import("../views/RouteTest.vue"),
  },
  {
    path: "/lifeCycleTest",
    name: "LifeCycleTest",
    component: () => import("../views/LifeCycleTest.vue"),
  },
  {
    path: "/detail",
    name: "Detail",
    component: () => import("../views/Detail.vue"),
  },
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
